#ifndef TAB_HPP
# define TAB_HPP

# include <QWidget>
# include <QVBoxLayout>
# include <QPaintEvent>
# include <QTime>
# include "Map.hpp"

# define MOUSE_MOVE_INTERVAL        25
# define MOUSE_TIME_INTERVAL        100

class Tab: public QWidget
{
public:
    Tab(Map* map);

    void        paintEvent(QPaintEvent*);

    void        mousePressEvent(QMouseEvent* event);
    void        mouseReleaseEvent(QMouseEvent* event);
    void        mouseMoveEvent(QMouseEvent *);

    void        setSelectedTile(QString const& name, QPixmap* tile);

    Map&        getMap();

    void        addTile(int posX, int posY);

private:
    QString     _tileName;
    QPixmap*    _tileImage;

    Map*        _map;

    QTime       _time;
    int         _lastTime;

    bool        _mousePressed;
};

#endif // TAB_HPP
